import { PureComponent } from "react";
import { connect } from "react-redux";
import { addNum } from "../store/features/counter";

class Profile extends PureComponent
{
    componentDidMount()
    {
        console.log("Profile's props", this.props);
    }

    addNum(num)
    {
        this.props.addNum(num);
    }

    render()
    {
        return (
            <div>
                <h2>Profile</h2>
           </div>
       )
    }
}

const mapStateToProps = (state) => {
    return {
        state:state,
    }
}

const mapDispatchToProps = (dispatch) => {
    return {
        addNNum(num)
        {
            dispatch(addNum(num));
        }
    }
}

export default  connect(mapStateToProps,mapDispatchToProps)(Profile);